﻿using Microsoft.Extensions.DependencyInjection;
namespace Nereus
{
    using Power;
    public static class NereusExtension
    {
        public static IServiceCollection AddNereus(this IServiceCollection serivceCollection, INBuilderConfigure nBuilderConfigure, INBuilder nBuilder = null, INDoucmentBuilder nDoucmentBuilder = null)
        {
            serivceCollection.AddSingleton(nBuilderConfigure);
            if (nBuilder == null)
            {
                nBuilder = new DefaultNBuilder();
            }
            serivceCollection.AddSingleton(nBuilder);
            if (nDoucmentBuilder != null) {
                serivceCollection.AddSingleton(nDoucmentBuilder);
            }

            return serivceCollection;
        }
    }
}
